<template>
  <button 
    class="maximize-btn"
    @click="toggleMaximize"
    :title="isMaximized ? '退出全屏' : '全屏'"
  >
    <i class="fas" :class="isMaximized ? 'fa-compress-alt' : 'fa-expand-alt'"></i>
  </button>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const isMaximized = ref(false)

const toggleMaximize = () => {
  isMaximized.value = !isMaximized.value
  document.body.style.overflow = isMaximized.value ? 'hidden' : ''
  document.querySelector('.tool-content')?.classList.toggle('maximized')
}
</script>

<style scoped lang="scss">
.maximize-btn {
  position: fixed;
  right: 20px;
  top: 90px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;

  i {
    color: #666;
    font-size: 1.1rem;
  }

  &:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    
    i {
      color: white;
    }
  }
}
</style> 